package com.company;

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.SQLException;

public class chursys {
    private JPanel panel1;
    private JTextField textField1;
    private JTextField textField2;
    private JButton 登记Button;

    public chursys() {
        JFrame chu=new JFrame("出入登记");
        chu.setSize(400,400);
        chu.add(panel1);
        chu.setLocation(400,250);
        chu.setVisible(true);
        登记Button.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                String[] gongyu=new String[2];
                gongyu[0]=textField1.getText();
                gongyu[1]=textField2.getText();
                ZSGC zs=new ZSGC();
                try {
                    zs.xuigai2(gongyu);
                    JOptionPane.showConfirmDialog(null, "登记成功");
                } catch (SQLException ex) {
                    ex.printStackTrace();
                }

            }
        });
    }
    public static void main(String[] args) {
        chursys cr=new chursys();
    }

    private void createUIComponents() {
        // TODO: place custom component creation code here
    }
}
